ifeq ($(MODULE_NAME),)
    MODULE_NAME := hello_sber
endif

ifeq ($(KERNEL_DIR),)
    KERNEL_DIR := /lib/modules/$(shell uname -r)/build
endif

obj-m += $(MODULE_NAME).o

$(MODULE_NAME)-objs := hello_sber.o

# Add the -D flag to pass MODULE_NAME to the C compiler
EXTRA_CFLAGS += -DMODULE_NAME=\"$(MODULE_NAME)\"

all:
	make -C $(KERNEL_DIR) M=$(PWD) MODULE_NAME=$(MODULE_NAME) modules

clean:
	make -C $(KERNEL_DIR) M=$(PWD) clean
